<template>
	<view class="layer2 flex-col">
		<view class="outer1 flex-col">
			<view class="section1 flex-row  align-center">
				<text class="word2">原密码</text>
				<input type="text" class="info1" placeholder="请输入原密码" v-model="data.password">
			</view>
		</view>
		<view class="outer1 flex-col">
			<view class="section1 flex-row  align-center">
				<text class="word2">新密码</text>
				<input type="text" class="info1" placeholder="请输入新密码" v-model="data.new_password">
			</view>
		</view>
		<view class="outer1 flex-col">
			<view class="section1 flex-row  align-center">
				<text class="word2">确认密码</text>
				<input type="text" class="info1" placeholder="请再次确认密码" v-model="data.re_password">
			</view>
		</view>
		<button class="Button1 flex-col" @click="onAdd">
			<text class="word3">确定修改</text>
		</button>
	</view>
</template>

<script setup>
	import {
		onShow,
		onLoad,
		onReachBottom
	} from "@dcloudio/uni-app";
	import {
		onMounted,
		ref,
		reactive,
		getCurrentInstance
	} from "vue"
	const {
		proxy
	} = getCurrentInstance()
	let token = ref('')
	let p = ref(1)
	let data = ref({
		shop_id:'',
		password:'',
		new_password:'',
		re_password:''
	})
	onShow(() => {
		// content.value.list.length = 0
		// p.value = 1
		// getDate()
		// getlist()
	})
	onReachBottom(() => {
		p.value++
		getlist()
	})
	const onAdd = () => {
		data.value.shop_id=uni.getStorageSync('shop_id')
		proxy.$req.requestPOST(proxy.$api.CenterInfo.setPass,data.value).then(res => {
			uni.showToast({
				title: res.message,
				icon: "none"
			})
			if (res.flag == "success") {
				setTimeout(()=>{
					uni.navigateBack({
						delta:2
					},1000)
				})
			}
		})
	}
	
	const toReflect = () => {
		uni.navigateTo({
			url: '/pages/Withdrawal1/Withdrawal1'
		})
	}
</script>


<style>
	.layer2 {
		width: 100vw;
		height: 100vh;
		background-color: rgba(245, 245, 245, 1);
		display: flex;
		align-items: center;
		padding-top: 30rpx;
		/* justify-content: space-between; */
	}

	.outer1 {
		background-color: rgba(255, 255, 255, 1);
		border-radius: 20rpx;
		height: 98rpx;
		margin-bottom: 20rpx;
		width: 690rpx;
	}

	.section1 {
		width: 100%;
		height: 27rpx;
		margin: 35rpx 0 0 31rpx;
	}

	.word2 {
		width: 172rpx;
		/* height: 27rpx; */
		color: rgba(51, 51, 51, 1);
		font-size: 28rpx;
		font-family: PingFangSC-;
		text-align: left;
		white-space: nowrap;
		line-height: 32rpx;
	}

	.info1 {
		width: 357rpx;
		/* height: 27rpx; */
		color: rgba(0, 0, 0, .8);
		font-size: 28rpx;
		text-align: left;
		/* margin-left:30rpx ; */
		white-space: nowrap;
		line-height: 28rpx;
		margin-top: -6rpx;
		/*  margin-top: -9rpx; */
	}

	.Button1 {
		height: 98rpx;
		background-color: #54bc6e;
		border: 0;
		border-radius: 20rpx;
		width: 670rpx;
		position: fixed;
		bottom: 50rpx;
		/* margin: 80rpx 0 0 10rpx; */
	}

	.word3 {
		width: 127rpx;
		height: 31rpx;
		color: rgba(255, 255, 255, 1);
		font-size: 32rpx;
		font-family: PingFangSC-;
		text-align: center;
		white-space: nowrap;
		line-height: 32rpx;
		margin: 34rpx 0 0 272rpx;
	}
</style>